/*
 * @Author: your name
 * @Date: 2022-03-03 19:58:36
 * @LastEditTime: 2022-03-25 15:45:13
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \blog-system-front\src\Containers\ContentHeader.js
 */
import React from "react";
import { Space, Typography } from "antd";
import { ArrowLeftOutlined } from "@ant-design/icons";
import { openTab } from "../util/menTab";
export default function ContentHeader(props) {
  const { title, children, backPath } = props;
  return (
    <div className="content_header">
      <div className="left_header">
        <Space>
          {backPath ? (
            <ArrowLeftOutlined
              onClick={() => {
                openTab({
                  key: backPath,
                });
                window.reactRouter.push(backPath);
              }}
            />
          ) : null}
          <Typography.Title level={4} style={{ margin: 0 }}>
            {title}
          </Typography.Title>
        </Space>
      </div>
      <div className="right_header">{children}</div>
    </div>
  );
}
